home *** CD-ROM | disk | FTP | other *** search
/ Aminet 49 / Aminet 49 (2002)(GTI - Schatztruhe)[!][Jun 2002].iso / Aminet / util / boot / WBSP_Prefs.lha / WBStartup+Prefs / Source / GetStringWindow.c < prev    next >
C/C++ Source or Header  |  2002-03-05  |  1KB  |  37 lines

  1. #include <exec/types.h>
  2. #include <libraries/mui.h>
  3.  
  4. #include <string.h>
  5. #include <proto/dos.h>
  6. #include <proto/exec.h>
  7. #include <proto/intuition.h>
  8. #include <proto/muimaster.h>
  9.  
  10. #include "WBStartup+Prefs.h"
  11.  
  12. void GetStringWindow(char *windowtitle,WORD len)
  13. {
  14.   /* char *windowtitle  The title of the window */
  15.   /* WORD len       The # of characters in buffer, including the added NULL */
  16.  
  17.   swinobj=MUI_NewObject("Window.mui",MUIA_Window_Title,windowtitle,
  18.                        MUIA_Window_RefWindow,winobj,
  19.                      MUIA_Window_LeftEdge,MUIV_Window_LeftEdge_Centered,
  20.                      MUIA_Window_TopEdge,MUIV_Window_TopEdge_Centered,
  21.                      MUIA_Window_RootObject,
  22.     MUI_NewObject("Group.mui",MUIA_Group_Child,
  23.         strobj=MUI_NewObject("String.mui",MUIA_String_MaxLen,(LONG)len,
  24.                           MUIA_Frame,MUIV_Frame_String,
  25.         TAG_DONE),
  26.     TAG_DONE),
  27.   TAG_DONE);
  28.   if (swinobj)
  29.   {
  30.           SetAttrs(winobj,MUIA_Window_Sleep,TRUE,TAG_DONE);
  31.       DoMethod(appobj,OM_ADDMEMBER,swinobj);
  32.       DoMethod(swinobj,MUIM_Notify,MUIA_Window_CloseRequest,TRUE,appobj,2,MUIM_Application_ReturnID,6);
  33.       DoMethod(strobj,MUIM_Notify,MUIA_String_Acknowledge,MUIV_EveryTime,appobj,2,MUIM_Application_ReturnID,5);
  34.       SetAttrs(swinobj,MUIA_Window_Open,TRUE,MUIA_Window_ActiveObject,strobj,TAG_DONE);
  35.   }
  36. }
  37.